// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use crate::Result;

/// Implements a [IcebergCatalogService](super::stub::IcebergCatalogService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct IcebergCatalogService<T>
where
    T: super::stub::IcebergCatalogService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> IcebergCatalogService<T>
where
    T: super::stub::IcebergCatalogService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::IcebergCatalogService for IcebergCatalogService<T>
where
    T: super::stub::IcebergCatalogService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn get_iceberg_catalog_config(
        &self,
        req: crate::model::GetIcebergCatalogConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::IcebergCatalogConfig>> {
        self.inner.get_iceberg_catalog_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_iceberg_namespaces(
        &self,
        req: crate::model::ListIcebergNamespacesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListIcebergNamespacesResponse>> {
        self.inner.list_iceberg_namespaces(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iceberg_namespace(
        &self,
        req: crate::model::GetIcebergNamespaceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::IcebergNamespace>> {
        self.inner.get_iceberg_namespace(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_iceberg_namespace(
        &self,
        req: crate::model::CreateIcebergNamespaceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::IcebergNamespace>> {
        self.inner.create_iceberg_namespace(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_iceberg_namespace(
        &self,
        req: crate::model::DeleteIcebergNamespaceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_iceberg_namespace(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_iceberg_namespace(
        &self,
        req: crate::model::UpdateIcebergNamespaceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::UpdateIcebergNamespaceResponse>> {
        self.inner.update_iceberg_namespace(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_iceberg_table_identifiers(
        &self,
        req: crate::model::ListIcebergTableIdentifiersRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListIcebergTableIdentifiersResponse>> {
        self.inner
            .list_iceberg_table_identifiers(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn create_iceberg_table(
        &self,
        req: crate::model::CreateIcebergTableRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<api::model::HttpBody>> {
        self.inner.create_iceberg_table(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_iceberg_table(
        &self,
        req: crate::model::DeleteIcebergTableRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_iceberg_table(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iceberg_table(
        &self,
        req: crate::model::GetIcebergTableRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<api::model::HttpBody>> {
        self.inner.get_iceberg_table(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn load_iceberg_table_credentials(
        &self,
        req: crate::model::GetIcebergTableRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::LoadIcebergTableCredentialsResponse>> {
        self.inner
            .load_iceberg_table_credentials(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn update_iceberg_table(
        &self,
        req: crate::model::UpdateIcebergTableRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<api::model::HttpBody>> {
        self.inner.update_iceberg_table(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn register_iceberg_table(
        &self,
        req: crate::model::RegisterIcebergTableRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<api::model::HttpBody>> {
        self.inner.register_iceberg_table(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iceberg_catalog(
        &self,
        req: crate::model::GetIcebergCatalogRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::IcebergCatalog>> {
        self.inner.get_iceberg_catalog(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_iceberg_catalogs(
        &self,
        req: crate::model::ListIcebergCatalogsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListIcebergCatalogsResponse>> {
        self.inner.list_iceberg_catalogs(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_iceberg_catalog(
        &self,
        req: crate::model::DeleteIcebergCatalogRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_iceberg_catalog(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_iceberg_catalog(
        &self,
        req: crate::model::UpdateIcebergCatalogRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::IcebergCatalog>> {
        self.inner.update_iceberg_catalog(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_iceberg_catalog(
        &self,
        req: crate::model::CreateIcebergCatalogRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::IcebergCatalog>> {
        self.inner.create_iceberg_catalog(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn failover_iceberg_catalog(
        &self,
        req: crate::model::FailoverIcebergCatalogRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::FailoverIcebergCatalogResponse>> {
        self.inner.failover_iceberg_catalog(req, options).await
    }
}
